package common.coucurrency;

import java.util.concurrent.CountDownLatch;

/**
 * Created by Gerardo on 1/27/14.
 */
public class Runner extends Thread {
	private final CountDownLatch timer;

	public Runner(final CountDownLatch timer, final String name) {
		this.timer = timer;
		this.setName(name);
		System.out.println(getName() + " ready");
		start();
	}

	@Override
	public void run() {
		try {
			timer.await();
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		System.out.println(getName() + "...run!");
	}
}
